package com.vvv.designpattern.ticket.product;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author vvv
 * @date 2023-11-25 14 38
 * discription建造者模式；
 * CompanyTicket为要建造的对象
 *原型模式：旨在新对象的创建可以通过克隆进行拷贝
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CompanyTicket implements Cloneable {
    // 发票固定不变的信息
    private String finalInfo;

    private String title;

    private String product;

    private String content;

    private String taxId;

    private String bankInfo;

    /**
     * 原型模式：旨在新对象的创建可以通过克隆进行拷贝
     * @return
     */
    @Override
    public CompanyTicket clone() {
        CompanyTicket companyTicket = null;
        try {
            companyTicket = (CompanyTicket) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return companyTicket;
    }

}
